Encoding data

ABSTRACT

Three-level (ternary) line codes are provided for use in transmitting binary data at high data rates (e.g. 100 Mbits/s) over twisted-pair cable, without producing excessive radiated emissions at frequencies above 30 MHz. A running digital sum (RDS) is computed for a stream of ternary symbols as it is encoded; if this RDS reaches a predetermined limit, the polarity of the next following non-zero symbol is determined so as to change the RDS towards zero. In addition, if the binary data stream and the RDS satisfy another predetermined criterion, such as the RDS having a particular polarity when two or more 0 symbols have occurred, then the next non-zero symbol is determined so as to have the opposite polarity; otherwise the next non-zero symbol has the opposite polarity to the preceding non-zero symbol. The RDS limit and the predetermined criterion can be selected to obtain a desired power spectral density for the ternary signal propagating over the twisted-pair cable.

TECHNICAL FIELD

This invention relates to methods and coders for encoding data.

BACKGROUND ART

The spread of personal computers and workstations has led to thedevelopment of networks for interconnecting such equipment and commonresources such as printers and data storage devices. More powerful andsophisticated computing equipment and programs have progressively becomeavailable, allowing the processing of data in larger and largerquantities, for example in the form of database information and graphicimages. These developments have placed increasing demands on the speedand capacity of networks.

Various new networking technologies have been proposed to cater forthese demands. One such technology is the fibre distributed datainterface (FDDI), which is based on the use of optical fibres andoptical signals. However, practical experience has shown that althoughthis technology can provide the required performance, it is relativelyexpensive, requiring the costly process of installing complete newnetworks of optical fibre, which is itself inherently expensive.

Accordingly attention has also been directed to the possibility oftransferring data at high speed over existing wiring installations,thereby avoiding the cost of installing a new network and gainingadditional return for the expense previously incurred in installing theexisting wiring.

One possible technique along these lines involves the use of unshieldedtwisted-pair (UTP) telephone cables of the kind already used forlower-speed local-area networks. In this technique, described inEuropean patent application No. 0 596 523, the required high data rate(100 Mbit/s) is achieved by transferring the data over four pairs ofconductors, so that different portions of the data are transmittedsimultaneously over respective conductor pairs. Each successive group oftwenty bits of the data to be transmitted is split into four blocks eachof five bits, and encoded by selecting six-bit code values from apredefined 5B/6B code table in accordance with the five-bit data values.The four encoded blocks are then transmitted along respective ones ofthe four conductor pairs. To limit the occurrence of undetectednoise-induced corruption of the data, particular data word/code wordcombinations may be used together with specific relative timing oftransmission of encoded blocks on different conductor pairs and a cyclicredundancy check (CRC) code, as described in European patent applicationNo. 0 596 736. The code words are also selected to maintain d.c. balanceon each individual conductor pair, by avoiding any long-term imbalancein the number of binary one and binary zero digits transmitted over theconductor pair. Thus the six-bit code words are selected fortransmission in such a way that either each code word transmitted over aconductor pair contains equal numbers of binary one and binary zerodigits (i.e. is inherently balanced), or has unequal numbers of thesedigits (i.e. is itself unbalanced) and is chosen to cancel any imbalanceintroduced by an earlier unbalanced code word.

This technique successfully attains an overall data rate of 100 Mbit/sover a cable containing four twisted pairs without exceeding regulatorylimits on electromagnetic emission. However, it is desirable to be ablealso to communicate data at this overall data rate over cable containingfewer than four twisted conductor pairs. In particular it is desirablein some circumstances to be able to communicate data in full-duplex mode(i.e. with simultaneous transmission in both directions along acommunications link) along a cable containing two so-called category 5(data grade) UTP conductors; this requires communication along each UTPconductor at the full 100 Mbit/s data rate.

It is an object of this invention to provide a method and coder forencoding data which facilitates such communication.

DISCLOSURE OF INVENTION

According to one aspect of this invention there is provided a method ofencoding binary data for communication wherein successive binary digitshaving first or second binary values are encoded as one of three signallevels, said method comprising the steps of:

selecting a first predetermined signal level to represent a binary digitif that digit has a first binary value;

selecting one of second and third predetermined signal levels torepresent a binary digit if that digit has a second binary value, saidfirst signal level being intermediate in value between said second andthird signal levels, said second and third signal levels being ofopposite polarity to one another, and selection between said second andthird signal levels being determined by:

maintaining a cumulative sum of signal levels already selected;

selecting said second signal level if said cumulative sum has attained afirst predetermined threshold;

selecting said third signal level if said cumulative sum has attained asecond predetermined threshold different from said first predeterminedthreshold;

selecting whichever of said second and third signal levels is not theone of those signals most recently selected, if said cumulative sum doesnot satisfy a predetermined criterion and said first predeterminedsignal level has been selected at least once since selection of eithersaid second or said third signal level;

selecting whichever of said second and third signals will change saidcumulative sum towards a predetermined value, if said cumulative sumdoes satisfy said predetermined criterion and said first predeterminedsignal level has been selected at least once since selection of eithersaid second or said third signal level; and

otherwise selecting whichever of said second and third signal levels isthe same as the one of those signals most recently selected.

According to another aspect of this invention there is provided a coderfor encoding binary data for communication such that successive binarydigits having first or second binary values are encoded as one of threesignal levels, comprising:

first selection means for selecting a first predetermined signal levelto represent a binary digit if that digit has a first binary value; and

second selection means for selecting one of second and thirdpredetermined signal levels to represent a binary digit if that digithas a second binary value, said first signal level being intermediate invalue between said second and third signal levels, said second and thirdsignal levels being of opposite polarity to one another, said secondselection means having:

means for maintaining a cumulative sum of signal levels alreadyselected;

means for selecting said second signal level if said cumulative sum hasattained a first predetermined threshold;

means for selecting said third signal level if said cumulative sum hasattained a second predetermined threshold different from said firstpredetermined threshold;

means for selecting whichever of said second and third signal levels isnot the one of those signals most recently selected, if said cumulativesum does not satisfy a predetermined criterion and said firstpredetermined signal level has been selected at least once sinceselection of either said second or said third signal level;

means for selecting whichever of said second and third signals willchange said cumulative sum towards a predetermined value, if saidcumulative sum does satisfy said predetermined criterion and said firstpredetermined signal level has been selected at least once sinceselection of either said second or said third signal level; and

means for selecting otherwise whichever of said second and third signallevels is the same as the one of those signals most recently selected.

BRIEF DESCRIPTION OF DRAWINGS

Methods and coders in accordance with this invention for encoding datafor communication along unshielded twisted-pair cable will now bedescribed, by way of example, with reference to the accompanyingdrawings, in which:

FIG. 1 shows the manner in which data may be formatted for communicationover the cable;

FIG. 2 shows a first arrangement for encoding and communicating dataover the cable;

FIG. 3 is a schematic diagram of a scrambler shown in FIG. 2;

FIG. 4 is a table of five-bit data values and corresponding six-bit codevalues;

FIG. 5 is a flow diagram of a method for encoding data blocks accordingto the code table in FIG. 4;

FIG. 6 is a state diagram of a first form of encoder which can be usedin the arrangement of FIG. 2;

FIG. 7 is a graph of power spectral density (PSD) of a random signalencoded using the encoder defined by FIG. 6;

FIG. 8 is a state diagram of a second form of encoder which can be usedin the arrangement of FIG. 2;

FIG. 9 is a state diagram of a third form of encoder which can be usedin the arrangement of FIG. 2;

FIG. 10 is a state diagram of a fourth form of encoder which can be usedin the arrangement of FIG. 2;

FIG. 11 shows a second arrangement for encoding and communicating dataover the cable; and

FIG. 12 shows the manner in which data are formatted for communicationover the cable in the arrangement of FIG. 11.

BEST MODE FOR CARRYING OUT THE INVENTION & INDUSTRIAL APPLICABILITY

The present invention may be used in circumstances where a stream ofdata is communicated over one or more channels; if more than one channelis used, successive portions of the data stream are communicatedsimultaneously over different respective channels in order to obtain ahigher bandwidth than would be possible if all the data were transmittedover a single such channel. For convenience the invention will bedescribed in the context of two-way transmission of data over a cablehaving two channels, such as two pairs of so-called category 5unshielded twisted pair (UTP) cabling, also known as data grade UTP.Each channel is used for data transmission in a respective direction. Inpractice the cable would, for example, form part of a network connectingmany stations or nodes, such as personal computers, workstations,multi-user computers, printers or data storage units. Circuit devicesassociated with these stations would provide the necessary functions forassembling data and network operating information into frames or packetsfor transmission, for controlling access to the network and fortransmitting and receiving physical signals on the cable (for example bydifferential signalling in the case of twisted-pair conductors). Thepresent invention is independent of the particular details of thesefunctions and may for example be implemented in conjunction withexisting network technologies; since such technologies alreadyincorporate known techniques for providing these functions, and thefunctions form no part of the present invention, they will not bedescribed here.

Referring to FIGS. 1 and 2, a data frame intended to be communicatedover a channel 22 is shown schematically at 10. This frame comprises: abinary digital message 12 to be transferred, starting with the leftmostbit as shown in FIG. 1, between stations on the network; and anassociated thirty-two bit CRC block 14 containing check data derivedfrom the message 12 in known manner in accordance with a predeterminedcyclic redundancy check (CRC) algorithm. In the present example it isassumed that the CRC value is derived from the message using apolynomial of degree thirty-two, such as

    g(x)=x.sup.32 +x.sup.26 +x.sup.23 +x.sup.22 +x.sup.16 +x.sup.12 +x.sup.11 +x.sup.10 +x.sup.8 +x.sup.7 +x.sup.5 +x.sup.4 +x.sup.2 +x+1.

Prior to transmission the contents of the data frame 10 are scrambled bya scrambler 18 (FIG. 2) in a predetermined and reversible manner bycombination with a pseudo-random binary sequence (PRBS). This ensuresthat the energy of the signal propagating over the channel 22 isdistributed reasonably uniformly throughout the intended bandwidth ofthe signal, irrespective of any repetitive bit patterns which may occurin the data frame 10. The PRBS is generated according to the bitrecurrence relation

    S n!=S n-9!XOR S n-11!

using an 11-stage shift register and an exclusive-OR gate which combinesthe bit values from the ninth and eleventh stages of the register andfeeds back to its first stage, as shown in FIG. 3. The bit sequenceappearing at the fifth stage of the register is combined with the bitsof the data frame 10 by another exclusive-OR gate to generate ascrambled data stream 16. The shift register is initialized with apreset 11-bit sequence (for example 11111111111).

For transmission over the channel 22 the scrambled data stream 16 issplit into consecutive blocks of n binary digits, starting with theleftmost bit of the data stream, and each block is encoded by a blockencoder 19 (described in more detail below) into a respective block ofn+1 binary digits. Each successive binary digit supplied by the encoder19 is then further encoded for transmission as a correspondingthree-level (ternary) symbol, by a binary to ternary encoder 20. Theternary symbols are represented herein by 0 (typically a zero-voltsignal on the channel 22), + (typically a positive polarity signal),and - (typically a negative polarity signal of the same magnitude asthe + signal).

A significant parameter of the codes discussed below is the runningdigital sum (RDS), which is related to the d.c. balance on acommunications channel using the code. In the case of a binary signal,the RDS is the difference between the accumulated totals of binary onesand zeroes in the signal (i.e. treating binary 0 as being opposite inpolarity to binary 1). For the ternary codes discussed herein, the RDSis the difference between the accumulated totals of + and-symbols in thesignal (i.e. the difference between the number of symbols of onepolarity and the number of the opposite polarity, the 0 symbol beingconsidered to have no polarity).

The block encoder 19 may be, for example, a 5B/6B encoder (n=5) arrangedto encode five-bit data blocks into six-bit values according to a 5B/6Bsubstitution table shown in FIG. 4, which may be held for example as alook-up table in a read-only memory. These particular substitutions areselected in part to maintain d.c. balance within the encoded binary datastream, by ensuring that after each coded data block the RDS of thebinary signal is no more than two. In the 5B/6B table shown in FIG. 4twenty of the five-bit data blocks are assigned unique codes comprisingrespective ones of the twenty six-bit values which contain three binaryzeroes and three binary ones. The remaining twelve data blocks are eachassigned two possible six-bit code values, one containing two binaryzeroes and the other containing four. The encoding is implemented sothat on the first occasion one of these twelve data blocks occurs, thecorresponding two-zero encoding (for example) is selected; on the nextoccasion that any of these twelve data blocks occurs, the correspondingfour-zero encoding is used; thereafter the use of the two-zero andfour-zero encodings continues to alternate for each occurrence of any ofthese twelve data blocks. Thus the numbers of two-zero and four-zerosix-bit codes will differ at most by one, maintaining an average ofthree binary zeroes per six-bit code and providing the desired d.c.balance (or limited RDS). In FIG. 1 illustrative five-bit (scrambled)data blocks are indicated in bold characters, and corresponding six-bitcode values are indicated immediately below them in normal weightcharacters.

FIG. 5 shows a flow diagram of a method for implementing this encodingboth in the arrangement of FIG. 1 and in the arrangement of FIG. 11 tobe described later. The steps and text depicted in dashed outline relateonly to encoding in the arrangement of FIG. 11 and may be ignored forthe purposes of the present description relating to FIG. 1. Referring toFIG. 5, at step 102 the data value to be encoded is tested to checkwhether it has one or two corresponding six-bit code values. If there isa unique corresponding code value, the procedure obtains that value fromthe look-up table at step 104 and exits. Otherwise the procedureadvances to step 106, where a boolean flag is tested. If the flag is`true`, the procedure selects the code value containing only two binaryzeroes, at step 108; if the flag is `false` the code value containingfour zeroes is selected, at step 10. In either case the procedure theninverts the value of the flag at step 112 before exiting.

The binary to ternary encoder 20 converts each binary digit output fromthe block encoder 19 into a corresponding ternary symbol (0, + or -),according to a coding scheme designed to restrict severely the powerspectral density (PSD) of the signal on the channel 22 at frequenciesabove 0.25 times the symbol rate, while maintaining acceptable limits onmaximum run length of sequences of the same ternary value and on the RDSof the ternary symbol stream.

To this end the encoder 20 updates a record of the RDS as each outputsymbol is generated, for comparison with predetermined upper and lowerRDS thresholds. These thresholds are selected in accordance with theamount of d.c. imbalance which can be tolerated in a particular case, atthe same time having regard for the effect on high frequency PSD of anyparticular RDS threshold. In general, a lower RDS threshold will tend toincrease the PSD somewhere in the higher frequency portion of thetransmitted signal's spectrum. Whenever the RDS reaches either of theupper and lower RDS thresholds, the encoder 20 will determine thepolarity of the next non-zero ternary symbol to be output so as tochange the RDS back towards a predetermined value of, in this case,zero.

In addition, whenever a non-zero ternary symbol is to be outputfollowing one or more 0 symbols, the encoder 20 tests whether the RDSsatisfies an additional predetermined criterion, and in accordance withthe result of that test and possible additional tests of the data streamdetermines whether or not the polarity of the non-zero ternary symbol tobe output will be opposite to the polarity of the non-zero ternarysymbol which preceded those one or more 0 symbols. The precise form ofthis predetermined criterion and of the possible additional tests can beselected to control the form of the PSD in the higher frequency portionof the transmitted signal's spectrum.

One example of the encoding which can be performed by the binary toternary encoder 20 is defined in the following truth table:

                                      TABLE 1                                     __________________________________________________________________________    Prev.                                                                              Prev.                                                                              Current                                                                           Next Last                    Ternary                            I/P bit                                                                            I/P bit                                                                            I/P bit                                                                           I/P bit                                                                            O/P RDS(n) =                                                                           RDS(n) -                                                                           RDS(n) +                                                                           RDS(n) =                                                                           O/P                                D(n - 2)                                                                           D(n - 1)                                                                           D(n)                                                                              D(n + 1)                                                                           polarity                                                                          min. ve   ve   max. (n + 1)                            __________________________________________________________________________    X    X    0   X    X   X    X    X    X    0                                  X    0    1   1    X   X    F    T    X    -                                  0    0    1   X    X   X    F    T    X    -                                  0    0    1   X    X   X    T    F    X    +                                  1    0    1   0    -   F    X    X    F    +                                  1    0    1   0    +   F    X    X    F    -                                  X    0    1   1    X   X    T    F    X    +                                  X    0    1   X    +   X    F    F    X    -                                  X    0    1   X    -   X    F    F    X    +                                  X    1    1   X    +   F    X    X    F    +                                  X    1    1   X    -   F    X    X    F    -                                  X    X    1   X    X   F    X    X    T    -                                  X    X    1   X    X   T    X    X    F    +                                  __________________________________________________________________________

In this table D(n) represents the binary digit which is currently beingreceived by the encoder 20, D(n-1) represents the previous digit, D(n-2)represents the digit before that, and D(n+1) represents the digit tofollow the one currently being received; X indicates a "don't care"condition or value; F represents a state in which the condition at thehead of the relevant column is False, and T represents a state in whichthat condition is True. Each row of the table defines a differentpossible combination of binary digits and states, and the symbol at theright-hand end of the row indicates the ternary symbol which is outputfor the respective combination.

This truth table implements the following set of rules for selecting aternary symbol for each binary digit:

a) a binary 1 is always encoded as a ternary + or a ternary -;

b) a binary 0 is always encoded as a ternary 0;

c) if a run of one or more ternary 0's occurs, the polarity of thefollowing non-zero symbol is opposite to the polarity of the non-zerosymbol preceding that run of 0's, unless:

i) the RDS is positive (i.e. greater than zero) and two or more ternary0's have occurred, in which case the following non-zero symbol is -; or

ii) the RDS is negative (i.e. less than zero) and two or more ternary0's have occurred, in which case the following non-zero symbol is +; or

iii) the RDS is positive and two or more non-zero ternary symbols followa ternary 0, in which case those non-zero ternary symbols are - symbols;or

iv) the RDS is negative and two or more non-zero ternary symbols followa ternary 0, in which case those non-zero ternary symbols are + symbols;

d) if the RDS reaches the predetermined upper or lower RDS threshold(min. or max.), the polarity of the next occurring non-zero symbol isopposite to the polarity of the most recently occurring non-zero symbol.

The encoder 20 can conveniently be implemented as a state machine, andFIG. 6 shows the state diagram for such a machine arranged to implementthe encoding defined in Table 1, with upper and lower RDS thresholds of3 and -3 respectively. In this state diagram each possible state isindicated by a circle, and possible transitions between states aredefined by arrows. Each transition arrow has an associated label, in theformat B/T: B indicates the input binary digit value which causes theassociated transition to occur, and T indicates the output ternarysymbol which is generated in conjunction with that transition. Whenencoding commences, one state is arbitrarily selected as a startingstate. This state machine incorporates a one-bit delay between input ofa binary digit and output of the ternary symbol actually representingthat digit, to facilitate implementation of rules (c)(iii) and (c)(iv)above. Thus a non-zero output ternary symbol actually corresponds to thepreceding binary 1 input, rather than to whatever binary digit iscurrently being input.

In FIG. 1 the ternary code symbols corresponding to the bits in theencoded six-bit counterparts of the illustrative five-bit data blocksare indicated below those bits; because of the one-bit delayincorporated in the state machine of FIG. 6, there is a one-symboloffset between each encoded binary digit and its corresponding ternarysymbol, as indicated by the dashed arrows in FIG. 1. In deriving theseillustrative symbols it has been assumed that the starting state in thestate diagram of FIG. 6 is the state indicated with an asterisk (*) inthe section where the RDS is zero.

The encoded ternary-symbol blocks are transmitted over the channel 22(leftmost symbol first), and upon receipt at their destination they aredetected and compensation is made in known manner for the effects oftiming drift and other signal degradation to produce a restored digitaldata stream. This data stream is then fed to a ternary to binary decoder24 which derives the binary digit corresponding to each successiveternary symbol. This may be done by assigning the binary value 0 foreach occurrence of ternary 0, and the binary value 1 for each occurrenceof either ternary + or ternary -.

The binary encoded data are then supplied to a block decoder 25 whichderives the five-bit data word corresponding to each six-bit encodedblock in accordance with the 5B/6B encoding table given in FIG. 4. Thedecoder 25 also maintains a running count of the imbalance between thetotals of binary ones and binary zeroes in the code words which itreceives.

For decoding, a broadly similar procedure to that of FIG. 5 may be used.However, instead of obtaining a code value at step 104, the decoder 25checks that the received code value is valid, and then obtains thecorresponding data value. Likewise, at steps 108 and 110, the decoder 25checks that the received code value is valid and has the expected numberof binary zero bits, and then obtains the required data value. If any ofthese checks fails, the decoder determines that an error has occurredduring transmission of the data frame and the entire frame is rejected.Otherwise the decoder 25 passes the decoded data to a de-scrambler 26which reverses the scrambling effected by the scrambler 18. This isaccomplished by generating a PRBS, and combining successive bits of thisPRBS with successive bits of the decoded data stream in an exclusive-ORoperation, in the same manner as described for the scrambler 18.

The descrambled data stream is passed to a CRC check circuit 28 whichassembles the complete data frame and recalculates the CRC value forcomparison with the transmitted CRC value. Assuming the CRC check doesnot reveal any corruption of the data, the frame is then available forfurther processing and use.

The binary-to-ternary encoding defined by Table 1 above has severaladvantageous properties. The RDS is limited to a predefined value, withthe result that the PSD is very low at d.c. and low frequencies (<0.01times the symbol rate on the channel 22). On the other hand, for a databit rate of 100 Mbit/s (equivalent to a symbol rate of 120 Mbaud in theabove example), the PSD at frequencies above 30 MHz is considerablylower than that below this frequency: most of the signal energy isconcentrated into the bandwidth up to 30 MHz. This is illustrated inFIG. 7, which shows the PSD for a random binary non-return to zero (NRZ)signal and for the same signal encoded in accordance with Table 1, as afunction of frequency, which is expressed as a fraction relative to thesymbol rate on the channel 22. Thus, for a symbol rate of 120 Mbaud, thePSD at 30 MHz is the value shown at a relative frequency of 0.25.Another advantage of this encoding is that, as described above, decodingfrom ternary to binary is readily accomplished, for example using arectifier, because of the direct correspondence between binary 0 andternary 0 on the one hand, and binary 1 and ternary + or - on the other.

It is possible to use other binary t_(Q) ternary encodings in theencoder 20. Table 2 below shows the truth table for a modification ofthe encoding defined in Table 1 above, using the same notation as inthat table:

                                      TABLE 2                                     __________________________________________________________________________    Prev.                                                                              Prev.                                                                              Prev.                                                                              Current                                                                           Next Last                    Ternary                       I/P bit                                                                            I/P bit                                                                            I/P bit                                                                            I/P bit                                                                           I/P bit                                                                            O/P RDS(n) =                                                                           RDS(n) -                                                                           RDS(n) +                                                                           RDS(n) =                                                                           O/P                           D(n - 3)                                                                           D(n - 2)                                                                           D(n - 1)                                                                           D(n)                                                                              D(n + 1)                                                                           polarity                                                                          min. ve   ve   max. (n + 1)                       __________________________________________________________________________    X    X    X    0   X    X   X    X    X    X    0                             X    X    0    1   1    X   X    F    T    X    -                             X    0    0    1   X    X   X    F    T    X    -                             X    0    0    1   X    X   X    T    F    X    +                             0    1    0    1   0    -   F    X    X    F    +                             0    1    0    1   0    +   F    X    X    F    -                             X    X    0    1   1    X   X    T    F    X    +                             X    X    0    1   X    +   X    F    F    X    -                             X    X    0    1   X    -   X    F    F    X    +                             X    X    1    1   X    +   F    X    X    F    +                             X    X    1    1   X    -   F    X    X    F    -                             X    X    X    1   X    X   F    X    X    T    -                             X    X    X    1   X    X   T    X    X    F    +                             1    1    0    1   0    X   X    F    T    X    -                             1    1    0    1   0    X   X    T    F    X    +                             __________________________________________________________________________     D(n - 3) represents the binary digit which occurred three bits before the     digit which is currently being received by the encoder 20.               

This truth table implements the following set of rules for selecting aternary symbol for each binary digit:

a) a binary 1 is always encoded as a ternary + or a ternary -;

b) a binary 0 is always encoded as a ternary 0;

c) if a run of one or more ternary 0's occurs, the polarity of thefollowing non-zero symbol is opposite to the polarity of the non-zerosymbol preceding that run of 0's, unless:

i) the RDS is positive (i.e. greater than zero) and two or more ternary0's have occurred, in which case the following non-zero symbol is -; or

ii) the RDS is negative (i.e. less than zero) and two or more ternary0's have occurred, in which case the following non-zero symbol is +; or

iii) the RDS is positive and two or more non-zero ternary symbols followa ternary 0, in which case those non-zero ternary symbols are - symbols;or

iv) the RDS is negative and two or more non-zero ternary symbols followa ternary 0, in which case those non-zero ternary symbols are + symbols;or

v) the RDS is positive and the run of ternary 0's is preceded by a runof two or more non-zero ternary symbols, in which case the followingnon-zero symbol is -; or

vi) the RDS is negative and the run of ternary 0's is preceded by a runof two or more non-zero ternary symbols, in which case the followingnon-zero symbol is +;

d) if the RDS reaches the predetermined upper or lower RDS threshold(min. or max.), the polarity of the next occurring non-zero symbol isopposite to the polarity of the most recently occurring non-zero symbol.

FIG. 8 shows the state diagram for a state machine arranged to implementthe encoding defined in Table 2, with upper and lower RDS thresholds of3 and -3 respectively, and using the same conventions as in FIG. 6.

Another possible encoding is defined by the truth table in Table 3,again with the same notation as in Tables 1 and 2:

                                      TABLE 3                                     __________________________________________________________________________    Prev.                                                                              Prev.                                                                              Current                                                                           Last                    Ternary                                 I/P bit                                                                            I/P bit                                                                            I/P bit                                                                           O/P RDS(n) =                                                                           RDS(n) -                                                                           RDS(n) +                                                                           RDS(n) =                                                                           O/P                                     D(n - 2)                                                                           D(n - 1)                                                                           D(n)                                                                              polarity                                                                          min. ve   ve   max. (n + 1)                                 __________________________________________________________________________    X    X    0   X   X    X    X    X    0                                       0    0    1   X   X    F    T    X    -                                       0    0    1   X   X    T    F    X    +                                       1    0    1   -   F    X    X    F    +                                       1    0    1   +   F    X    X    F    -                                       X    0    1   +   X    F    F    X    -                                       X    0    1   -   X    F    F    X    +                                       X    1    1   +   F    X    X    F    +                                       X    1    1   -   F    X    X    F    -                                       X    X    1   X   F    X    X    T    -                                       X    X    1   X   T    X    X    F    +                                       __________________________________________________________________________

This truth table implements the following set of rules for selecting aternary symbol for each binary digit:

a) a binary 1 is always encoded as a ternary + or a ternary -;

b) a binary 0 is always encoded as a ternary 0;

c) if a run of one or more ternary 0's occurs, the polarity of thefollowing non-zero symbol is opposite to the polarity of the non-zerosymbol preceding that run of 0's, unless:

i) the RDS is positive (i.e. greater than zero) and two or more ternary0's have occurred, in which case the following non-zero symbol is -; or

ii) the RDS is negative (i.e. less than zero) and two or more ternary0's have occurred, in which case the following non-zero symbol is +;

d) if the RDS reaches the predetermined upper or lower RDS threshold(min. or max.), the polarity of the next occurring non-zero symbol isopposite to the polarity of the most recently occurring non-zero symbol.

FIG. 9 shows the state diagram for a state machine arranged to implementthe encoding defined in Table 3, with upper and lower RDS thresholds ofx/2 and -x/2 respectively. Each possible state is indicated by a circle,and possible transitions between states are defined by arrows. Eachtransition arrow has an associated label indicating the input binarydigit value which causes the associated transition to occur; the outputternary symbol which is generated in response to that transition isindicated at the left of the diagram, in alignment with the destinationstate of the relevant transition.

Another possible encoding is defined by the truth table in Table 4,again with the same notation as in previous tables:

                                      TABLE 4                                     __________________________________________________________________________    Prev.                                                                              Current                                                                            Last                    Ternary                                     I/P bit                                                                            I/P bit                                                                            O/P RDS(n) =                                                                           RDS(n) -                                                                           RDS(n) +                                                                           RDS(n) =                                                                           O/P                                         D(n - 1)                                                                           D(n) polarity                                                                          min. ve   ve   max. (n + 1)                                     __________________________________________________________________________    X    0    X   X    X    X    X    0                                           0    1    X   X    F    T    X    -                                           0    1    X   X    T    F    X    +                                           0    1    +   X    F    F    X    -                                           0    1    -   X    F    F    X    +                                           1    1    +   F    X    X    F    +                                           1    1    X   F    X    X    T    -                                           1    1    -   F    X    X    F    -                                           1    1    X   T    X    X    F    +                                           __________________________________________________________________________

This truth table implements the following set of rules for selecting aternary symbol for each binary digit:

a) a binary 1 is always encoded as a ternary + or a ternary -;

b) a binary 0 is always encoded as a ternary 0;

c) if a run of one or more ternary 0's occurs, the polarity of thefollowing non-zero symbol is opposite to the polarity of the non-zerosymbol preceding that run of 0's, unless:

i) the RDS is positive (i.e. greater than zero), in which case thefollowing non-zero symbol is -; or

ii) the RDS is negative (i.e. less than zero), in which case thefollowing non-zero symbol is +;

d) if the RDS reaches the predetermined upper or lower RDS threshold(min. or max.), the polarity of the next occurring non-zero symbol isopposite to the polarity of the most recently occurring non-zero symbol.

FIG. 10 shows the state diagram for a state machine arranged toimplement the encoding defined in Table 4, with upper and lower RDSthresholds of x/2 and -x/2 respectively, and using the same conventionsas in FIG. 9.

As noted above, systems for transmitting data at an effective data rateof 100 Mbit/s over a cable containing four twisted pairs have previouslybeen described in European patent applications Nos. 0 596 523 and 0 596736. It can be cost-effective to use components intended for such asystem to implement a binary-to-ternary encoding as described above.FIGS. 11 and 12 illustrate an arrangement for accomplishing this.

Referring to FIGS. 11 and 12, the data frame 10 to be transmitted overthe channel 22 is supplied to a unit 30 containing a scrambler 18Asimilar in function and operation to the scrambler 18 in FIG. 2, a 5B/6Bblock encoder 32 (corresponding to the block encoder 19 in FIG. 2), anda `de-multiplexer` 34. This unit 30 is designed primarily for use in asystem transferring data over four twisted pairs, each pair carrying arespective data stream (herein labelled A to D). In such a systemsuccessive five-bit blocks in the data frame 10 are assigned among thefour data streams on a cyclic basis and starting with the blockcontaining the leftmost bit of the frame 10. Thus this first block,indicated by A1 in FIG. 12, is associated with stream A, the next block(B1) with stream B, the third block (C1) with stream C and the fourth(D1) with stream D. The cycle then repeats, with stream A receiving thefifth block (A2) and so on.

Preferably the scrambler 18A can save and restore four copies of thecontents of its shift register. Thus, for the first five-bit block A1, arespective initializing sequence is loaded into the shift register andthe block A1 is scrambled; the contents of the shift register are saved,a new initializing sequence, from a different quadrant of the PRBS, isloaded into the register, and the block B1 is scrambled; theseoperations are repeated for each of the blocks C1 and D1; then the shiftregister contents after scrambling of the block A1 are restored, and theblock A2 is scrambled; and so on.

The scrambled five-bit data blocks are encoded by the encoder 32 intosix-bit values as described below, and the encoded blocks are thentemporarily distributed by the `de-multiplexer` 34 among the four datastreams A to D.

The use of the unit 30 in the present arrangement provides economies inthe cost of implementing circuit functions which are requiredirrespective of the number of conductors used to transmit data, andfacilitates design of other parts of an overall system independently ofthe physical details of the transmission channel or channels.

The data streams A to D produced by the de-multiplexer 34 are recombinedby a block multiplexer 36 into a single stream of encoded blocks, theencoded form of block A1 being followed by the encoded form of blocksB1, C1, D1, A2, B2, and so on. This single stream of encoded blocks issupplied to a binary-digit to ternary-symbol encoder 38, which operatesin the same manner as the encoder 20 in FIG. 2 to provide the actualencoded data stream for transmission over the channel 22.

The 5B/6B block encoder 32 operates in a similar manner to the encoder19 in FIG. 2, but with additional functionality to maintain d.c. balance(i.e. limit the RDS) within each of the individual data streams A to D(to provide for the case where they are transmitted in parallel over acable having four twisted pairs). Thus the use of the two-zero andfour-zero encodings in FIG. 4 alternates for each data stream A to Dindividually upon each occurrence of any of the twelve relevant five-bitdata blocks in that data stream. In FIG. 12 illustrative five-bit(scrambled) data blocks are indicated in bold characters, andcorresponding six-bit code values and ternary symbols are indicatedimmediately below them in normal weight characters.

The method shown in FIG. 5 for implementing the 5B/6B encoding ismodified in this case to include the steps and text depicted in dashedlines. Specifically a step 100 is included in which a counter R isincremented according to the relationship

    R=(R+1)modulo 4

so that the counter cyclically takes on the values zero to threeinclusive. The purpose of this counter is to keep track of the datastream A to D to which the current data value relates. Step 106 ismodified so that one of four boolean flags (corresponding to the datastreams A to D) is tested, the flag being selected in accordance withthe current value of the counter R. Likewise at step 112 the flag whosevalue is to be inverted is selected in accordance with the value of thecounter R.

When the encoded data blocks reach their destination on the channel 22they are detected and compensation is made in known manner for theeffects of timing drift and other signal degradation to produce arestored digital data stream. This data stream is then fed to a decodingcircuit 40 which derives the binary digit corresponding to eachsuccessive ternary symbol. This may be done by assigning the binaryvalue 0 for each occurrence of ternary 0, and the binary value 1 foreach occurrence of either ternary + or ternary -.

The binary encoded data from the decoder 40 are then supplied to ade-multiplexer 42 which operates analogously to the de-multiplexer 34 toproduce four data streams A to D, which are then `multiplexed` backtogether by a multiplexer 46 forming part of a multiplexer/decoder unit44 primarily intended for use in a system transmitting data over fourtwisted pairs. The resulting data stream is fed to a block decoder 48 inthe unit 44, and this decoder derives the five-bit data wordcorresponding to each six-bit encoded block in accordance with the 5B/6Bencoding table in FIG. 4. The decoder 48 also maintains a running countfor each data stream A to D of the imbalance between the totals ofbinary ones and binary zeroes in the code words which it receives.

For decoding, a broadly similar procedure to that of FIG. 5 (includingitems in dashed lines) may be used. However, instead of obtaining a codevalue at step 104, the decoder 48 checks that the received code value isvalid, and then obtains the corresponding data value. Likewise, at steps108 and 110, the decoder 48 checks that the received code value is validand has the expected number of binary zero bits, and then obtains therequired data value. If any of these checks fails, the decoderdetermines that an error has occurred during transmission of the dataframe and the entire frame is rejected. Otherwise the decoder 48 passesthe decoded data to a de-scrambler 26A in the unit 44, to reverse thescrambling effected by the scrambler 18A.

The descrambled data stream is passed to a CRC check circuit (not shown)which assembles the complete data frame and recalculates the CRC valuefor comparison with the transmitted CRC value. Assuming the CRC checkdoes not reveal any corruption of the data, the frame is then availablefor further processing and use.

In the embodiments described above, it has been assumed that a binary 0corresponds to a ternary 0, and a binary 1 corresponds to a ternary + or-. The invention may also be implemented with the reversecorrespondence, i.e. a binary 1 corresponds to a ternary 0 and a binary0 corresponds to a ternary + or -. Although the invention has beendescribed in the context of ternary encoding of a binary block code(i.e. the 5B/6T code of FIG. 4), the invention is applicable to encodingof any binary digit stream irrespective of its internal data structure.

For clarity the invention has been described in the context of a systemin which the upper and lower RDS thresholds are equal in magnitude andopposite in polarity, and a predetermined value of zero is used both forcomparison with the RDS in rule (c) of each of the sets of rules set outabove, and as the value towards which the RDS is changed in rule (d).However, the invention is also applicable in circumstances where theupper and lower RDS thresholds are not equal, nor even of differentpolarities, and the predetermined value may be non-zero (although itwill be a value between the upper and lower thresholds). In suchcircumstances the system operates with a permanent offset related to thepredetermined non-zero value.

I claim:
 1. A method of encoding binary data for communication whereinsuccessive binary digits having first or second binary values areencoded as one of three signal levels, said method further controllingsaid encoding to assure that a running digital sum of said signal levelsremains within predetermined thresholds to restrict any d.c. imbalanceon a communication channel, said method comprising the stepsof:selecting a first predetermined signal level to represent a binarydigit if that digit has a first binary value; selecting one of secondand third predetermined signal levels to represent a binary digit ifthat digit has a second binary value, said first signal level beingintermediate in value between said second and third signal levels, saidsecond and third signal levels being of opposite polarity to oneanother, and selection between said second and third signal levels beingdetermined by:maintaining a cumulative sum of signal levels alreadyselected; selecting said second signal level if said cumulative sum hasattained a first predetermined threshold; selecting said third signallevel if said cumulative sum has attained a second predeterminedthreshold different from said first predetermined threshold; selectingwhichever of said second and third signal levels is not the one of thosesignals most recently selected, if said cumulative sum does not satisfya predetermined criterion and said first predetermined signal level hasbeen selected at least once since selection of either said second orsaid third signal level; selecting whichever of said second and thirdsignals will change said cumulative sum towards a predetermined value,if said cumulative sum does satisfy said predetermined criterion andsaid first predetermined signal level has been selected at least oncesince selection of either said second or said third signal level; andotherwise selecting whichever of said second and third signal levels isthe same as the one of those signals most recently selected.
 2. Themethod of claim 1, wherein said predetermined criterion is that saidcumulative sum does not equal said predetermined value and said firstpredetermined signal level has been selected at least twice sinceselection of either said second or said third signal level.
 3. Themethod of claim 1, wherein said predetermined criterion is that saidcumulative sum does not equal said predetermined value.
 4. The method ofclaim 1, wherein said predetermined criterion is that said cumulativesum does not equal said predetermined value and:said first predeterminedsignal level has been selected at least twice since selection of eithersaid second or said third signal level; or said first predeterminedsignal level has been selected at least once and thereafter either ofsaid second and said third signal levels are to be selected at leasttwice in succession.
 5. The method of claim 1, wherein said first andsecond predetermined thresholds have equal magnitudes and oppositepolarities to one another, and said predetermined value is zero.
 6. Amethod of encoding binary data for communication over a communicationchannel to assure that a running digital sum of encoded binary dataremains within predetermined thresholds to restrict any d.c. imbalanceon said communication channel, wherein successive binary digits areencoded as one of three signal levels in accordance with the followingtruth table:

    __________________________________________________________________________    Prev.                                                                              Prev.                                                                              Current                                                                           Next Last                    Ternary                            I/P bit                                                                            I/P bit                                                                            I/P bit                                                                           I/P bit                                                                            O/P RDS(n) =                                                                           RDS(n) <                                                                           RDS(n) >                                                                           RDS(n) =                                                                           O/P                                D(n - 2)                                                                           D(n - 1)                                                                           D(n)                                                                              D(n + 1)                                                                           polarity                                                                          min. PV   PV   max. (n + 1)                            __________________________________________________________________________    X    X    A   X    X   X    X    X    X    0                                  X    A    B   B    X   X    F    T    X    -                                  A    A    B   X    X   X    F    T    X    -                                  A    A    B   X    X   X    T    F    X    +                                  B    A    B   A    -   F    X    X    F    +                                  B    A    B   A    +   F    X    X    F    -                                  X    A    B   B    X   X    T    F    X    +                                  X    A    B   X    +   X    F    F    X    -                                  X    A    B   X    -   X    F    F    X    +                                  X    B    B   X    +   F    X    X    F    +                                  X    B    B   X    -   F    X    X    F    -                                  X    X    B   X    X   F    X    X    T    -                                  X    X    B   X    X   T    X    X    F    +                                  __________________________________________________________________________

wherein D(n) represents a binary digit which is currently beingreceived, D(n-1) represents an immediately preceding digit, D(n-2)represents a digit immediately preceding digit D(n-1), D(n+1) representsa digit to follow the one currently being received, PV represents apredetermined value, X indicates a "don't care" condition, A representsa first binary value, B represents a second binary value, F represents astate in which a condition is false, T represents a state in which thatcondition is true, and RDS signifies running digital sum of ternarysymbols already produced, said encoding assuring that the RDS remainswithin predetermined thresholds to restrict said d.c. imbalance on saidcommunication channel.
 7. A method of encoding binary data forcommunication over a communication channel to assure that a runningdigital sum of encoded binary data remains within predeterminedthresholds to restrict any d.c. imbalance on said communication channel,wherein successive binary digits are encoded as one of three signallevels in accordance with the following truth table:

    __________________________________________________________________________    Prev.                                                                              Prev.                                                                              Prev.                                                                              Current                                                                           Next Last                    Ternary                       I/P bit                                                                            I/P bit                                                                            I/P bit                                                                            I/P bit                                                                           I/P bit                                                                            O/P RDS(n) =                                                                           RDS(n) <                                                                           RDS(n) >                                                                           RDS(n) =                                                                           O/P                           D(n - 3)                                                                           D(n - 2)                                                                           D(n - 1)                                                                           D(n)                                                                              D(n + 1)                                                                           polarity                                                                          min. PV   PV   max. (n + 1)                       __________________________________________________________________________    X    X    X    A   X    X   X    X    X    X    0                             X    X    A    B   B    X   X    F    T    X    -                             X    A    A    B   X    X   X    F    T    X    -                             X    A    A    B   X    X   X    T    F    X    +                             A    B    A    B   A    -   F    X    X    F    +                             A    B    A    B   A    +   F    X    X    F    -                             X    X    A    B   B    X   X    T    F    X    +                             X    X    A    B   X    +   X    F    F    X    -                             X    X    A    B   X    -   X    F    F    X    +                             X    X    B    B   X    +   F    X    X    F    +                             X    X    B    B   X    -   F    X    X    F    -                             X    X    X    B   X    X   F    X    X    T    -                             X    X    X    B   X    X   T    X    X    F    +                             B    B    A    B   A    X   X    F    T    X    -                             B    B    A    B   A    X   X    T    F    X    +                             __________________________________________________________________________

wherein D(n) represents a binary digit which is currently beingreceived, D(n-1) represents an immediately preceding digit, D(n-2)represents a digit immediately preceding digit D(n-1), D(n-3) representsa digit immediately preceding digit D(n-2), D(n+1) represents a digit tofollow the one currently being received, PV represents a predeterminedvalue, X indicates a "don't care" condition, A represents a first binaryvalue, B represents a second binary value, F represents a state in whicha condition is false, T represents a state in which that condition istrue, and RDS signifies running digital sum of ternary symbols alreadyproduced, said encoding assuring that the RDS remains withinpredetermined thresholds to restrict said d.c. imbalance on saidcommunication channel.
 8. A method of encoding binary data forcommunication over a communication channel to assure that a runningdigital sum of encoded binary data remains within predeterminedthresholds to restrict any d.c. imbalance on said communication channel,wherein successive binary digits are encoded as one of three signallevels in accordance with the following truth table:

    __________________________________________________________________________    Prev.                                                                              Prev.                                                                              Current                                                                           Last                    Ternary                                 I/P bit                                                                            I/P bit                                                                            I/P bit                                                                           O/P RDS(n) =                                                                           RDS(n) <                                                                           RDS(n) >                                                                           RDS(n) =                                                                           O/P                                     D(n - 2)                                                                           D(n - 1)                                                                           D(n)                                                                              polarity                                                                          min. PV   PV   max. (n + 1)                                 __________________________________________________________________________    X    X    A   X   X    X    X    X    0                                       A    A    B   X   X    F    T    X    -                                       A    A    B   X   X    T    F    X    +                                       B    A    B   -   F    X    X    F    +                                       B    A    B   +   F    X    X    F    -                                       X    A    B   +   X    F    F    X    -                                       X    A    B   -   X    F    F    X    +                                       X    B    B   +   F    X    X    F    +                                       X    B    B   -   F    X    X    F    -                                       X    X    B   X   F    X    X    T    -                                       X    X    B   X   T    X    X    F    +                                       __________________________________________________________________________

wherein D(n) represents a binary digit which is currently beingreceived, D(n-1) represents an immediately preceding digit, D(n-2)represents a digit immediately preceding digit D(n-1), PV represents apredetermined value, X indicates a "don't care" condition, A representsa first binary value, B represents a second binary value, F represents astate in which a condition is false, T represents a state in which thatcondition is true, and RDS signifies running digital sum of ternarysymbols already produced, said encoding assuring that the RDS remainswithin predetermined thresholds to restrict said d.c. imbalance on saidcommunication channel.
 9. A method of encoding binary data forcommunication over a communication channel to assure that a runningdigital sum of encoded binary data remains within predeterminedthresholds to restrict any d.c. imbalance on said communication channel,wherein successive binary digits are encoded as one of three signallevels in accordance with the following truth table:

    __________________________________________________________________________    Prev.                                                                              Current                                                                            Last                    Ternary                                     I/P bit                                                                            I/P bit                                                                            O/P RDS(n) =                                                                           RDS(n) <                                                                           RDS(n) >                                                                           RDS(n) =                                                                           O/P                                         D(n - 1)                                                                           D(n) polarity                                                                          min. PV   PV   max. (n + 1)                                     __________________________________________________________________________    X    A    X   X    X    X    X    0                                           A    B    X   X    F    T    X    -                                           A    B    X   X    T    F    X    +                                           A    B    +   X    F    F    X    -                                           A    B    -   X    F    F    X    +                                           B    B    +   F    X    X    F    +                                           B    B    X   F    X    X    T    -                                           B    B    -   F    X    X    F    -                                           B    B    X   T    X    X    F    +                                           __________________________________________________________________________

wherein D(n) represents a binary digit which is currently beingreceived, D(n-1) represents an immediately preceding digit, PVrepresents a predetermined value, X indicates a "don't care" condition,A represents a first binary value, B represents a second binary value, Frepresents a state in which a condition is false, T represents a statein which that condition is true, and RDS signifies running digital sumof ternary symbols already produced, said encoding assuring that the RDSremains within predetermined thresholds to restrict said d.c. imbalanceon said communication channel.
 10. A coder for encoding binary data forcommunication over a communication channel such that successive binarydigits having first or second binary values are encoded as one of threesignal levels, said coder further controlling said encoding to assurethat a running digital sum of said signal levels remains withinpredetermined thresholds to restrict any d.c. imbalance on saidcommunication channel, said coder comprising:first selection means forselecting a first predetermined signal level to represent a binary digitif that digit has a first binary value; and second selection means forselecting one of second and third predetermined signal levels torepresent a binary digit if that digit has a second binary value, saidfirst signal level being intermediate in value between said second andthird signal levels, said second and third signal levels being ofopposite polarity to one another, said second selection meanshaving:means for maintaining a cumulative sum of signal levels alreadyselected; means for selecting said second signal level if saidcumulative sum has attained a first predetermined threshold; means forselecting said third signal level if said cumulative sum has attained asecond predetermined threshold different from said first predeterminedthreshold; means for selecting whichever of said second and third signallevels is not the one of those signals most recently selected, if saidcumulative sum does not satisfy a predetermined criterion and said firstpredetermined signal level has been selected at least once sinceselection of either said second or said third signal level; means forselecting whichever of said second and third signals will change saidcumulative sum towards a predetermined value, if said cumulative sumdoes satisfy said predetermined criterion and said first predeterminedsignal level has been selected at least once since selection of eithersaid second or said third signal level; and means for selectingotherwise whichever of said second and third signal levels is the sameas the one of those signals most recently selected.
 11. A coder forencoding binary data for communication over a communication channel,said coder further controlling said encoding to assure that a runningdigital sum of said signal levels remains within predeterminedthresholds to restrict any d.c. imbalance on said communication channel,said coder comprising means for encoding successive binary digits as oneof three signal levels in accordance with the following truth table:

    __________________________________________________________________________    Prev.                                                                              Prev.                                                                              Current                                                                           Next Last                    Ternary                            I/P bit                                                                            I/P bit                                                                            I/P bit                                                                           I/P bit                                                                            O/P RDS(n) =                                                                           RDS(n) <                                                                           RDS(n) >                                                                           RDS(n) =                                                                           O/P                                D(n - 2)                                                                           D(n - 1)                                                                           D(n)                                                                              D(n + 1)                                                                           polarity                                                                          min. PV   PV   max. (n + 1)                            __________________________________________________________________________    X    X    A   X    X   X    X    X    X    0                                  X    A    B   B    X   X    F    T    X    -                                  A    A    B   X    X   X    F    T    X    -                                  A    A    B   X    X   X    T    F    X    +                                  B    A    B   A    -   F    X    X    F    +                                  B    A    B   A    +   F    X    X    F    -                                  X    A    B   B    X   X    T    F    X    +                                  X    A    B   X    +   X    F    F    X    -                                  X    A    B   X    -   X    F    F    X    +                                  X    B    B   X    +   F    X    X    F    +                                  X    B    B   X    -   F    X    X    F    -                                  X    X    B   X    X   F    X    X    T    -                                  X    X    B   X    X   T    X    X    F    +                                  __________________________________________________________________________

wherein D(n) represents a binary digit which is currently beingreceived, D(n-1) represents an immediately preceding digit, D(n-2)represents a digit immediately preceding digit D(n-1), D(n+1) representsa digit to follow the one currently being received, PV represents apredetermined value, X indicates a "don't care" condition, A representsa first binary value, B represents a second binary value, F represents astate in which a condition is false, T represents a state in which thatcondition is true, and RDS signifies running digital sum of ternarysymbols already produced.